<?php
// +----------------------------------------------------------------------
// | 萤火商城系统 [ 致力于通过产品和服务，帮助商家高效化开拓市场 ]
// +----------------------------------------------------------------------
// | Copyright (c) 2017~2024 https://www.yiovo.com All rights reserved.
// +----------------------------------------------------------------------
// | Licensed 这不是一个自由软件，不允许对程序代码以任何形式任何目的的再发行
// +----------------------------------------------------------------------
// | Author: 萤火科技 <admin@yiovo.com>
// +----------------------------------------------------------------------
declare (strict_types = 1);

namespace app\api\model\meal;

use app\common\model\meal\Menu as MenuModel;
use app\store\model\meal\MenuRel as MenuRelModel;
use think\facade\Db;

/**
 * 商品图片模型
 * Class Menu
 * @package app\api\model
 */
class Menu extends MenuModel
{
    /**
     * 隐藏字段
     * @var array
     */
    protected $hidden = [
        'store_id',
        'create_time',
    ];

    public function getDetail($date = '')
    {
     
        $menu_id = Db::name('foods_menu')->where('date', $date)->value('menu_id');

        $model                 = new MenuRelModel;
        $list['breakfastList'] = $model->getList($menu_id, 1);
        $list['lunchList']     = $model->getList($menu_id, 2);
        $list['dinnerList']    = $model->getList($menu_id, 3);

        return $list;

    }

}
